<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Canvas</title>
    <style type="text/css">
        body {
            text-align: center;
            padding-top: 20px;
        }
        canvas {
            box-shadow: 0 0 10px #333;
            margin: 0 auto;
        }
    </style>
</head>
<body onload="draw()">
<canvas id="canvas" width="800" height="600">
    你的浏览器太 low 了，请更新~!
</canvas>

<script>
    function draw() {
        var canvas = document.getElementById("canvas");
        if (canvas.getContext) {
            var ctx = canvas.getContext('2d');

            // 圆的组成：圆心(x, y) 半径 开始角度 结束角度 顺时针/逆时针
            ctx.strokeStyle = 'orange';
            ctx.lineWidth = 10;

            // 画圆
            // ctx.arc(x, y, radius, startAngle, endAngle, anticlockwise);
            // ctx.arc(400, 300, 150, 0, Math.PI, false);
            // ctx.arc(400, 300, 150, 0, Math.PI / 2, false);
            ctx.arc(400, 300, 150, 0, Math.PI * 2);
            // ctx.arc(400, 300, 150, 0, Math.PI * 1.5);
            ctx.stroke();
        }
    }
</script>
</body>
</html>
